package com.woniuxy02;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-06-06 10:37
 */
public class StudentTest {

    public static void main(String[] args) {
        //输入用户名，密码，验证
        Scanner sc = new Scanner(System.in);
        System.out.println("输入用户名:");
        String name = sc.next();
        System.out.println("输入密码:");
        String pwd = sc.next();
        //登录成功，进入系统，登录失败，提示错误信息:(用户名不存在，密码错误)
//        if(StudentService.login(name, pwd)!=null){
//            System.out.println("登录成功");
//        }else {
//            System.out.println("用户名密码错误,登录失败");
//        }

//        try{
//            Student student  StudentService.login(name, pwd);
//            System.out.println("登录成功,欢迎:"+student);
//        }catch (Exception e){
//            System.out.println(e.getMessage());
//        }

        Student student = StudentService.login(name, pwd);
        System.out.println("登录成功,欢迎:" + student);


    }

}
